package com.koalac.ironman.net.pojo.response;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONObject;

public class HomePage extends BaseResponse {

    private ArrayList<Picture> homePictureList = new ArrayList<Picture>();
    private HomeClass homeClass = new HomeClass();

    @Override
    public void init(JSONObject source) {
	if (source != null) {
	    JSONArray jsonArray = source.optJSONArray("home_picture");
	    if (jsonArray != null) {
		for (int i = 0; i < jsonArray.length(); i++) {
		    JSONObject jsonObject = jsonArray.optJSONObject(i);
		    Picture picture = new Picture();
		    picture.init(jsonObject);
		    homePictureList.add(picture);
		}
	    }
	   homeClass.init(source.optJSONObject("home_class_gallery"));
	}
    }
    
    public ArrayList<Picture> getHomePictureList() {
        return homePictureList;
    }

    public void setHomePictureList(ArrayList<Picture> homePictureList) {
        this.homePictureList = homePictureList;
    }

    public HomeClass getHomeClass() {
        return homeClass;
    }

    public void setHomeClass(HomeClass homeClass) {
        this.homeClass = homeClass;
    }

}
